/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Principal;

import java.io.FileInputStream;
//import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

/**
 *
 * @author Nikita
 */
public class Serializadora{
    private ObjectOutputStream salida ;
    private ObjectInputStream entrada;

    public void serializar (Object object)throws IOException, ClassNotFoundException{

       
           salida = new ObjectOutputStream(new FileOutputStream("archivo"));
           salida.writeObject(object);
        

    }

    public Object deserializar (String archivo) throws IOException, ClassNotFoundException {
           
           entrada = new ObjectInputStream(new FileInputStream(archivo));
           System.out.println("Lo leyo");
           return entrada.readObject();
           
    }

    public ObjectInputStream getEntrada() {
        return entrada;
    }

    public void setEntrada(ObjectInputStream entrada) {
        this.entrada = entrada;
    }

    public ObjectOutputStream getSalida() {
        return salida;
    }

    public void setSalida(ObjectOutputStream salida) {
        this.salida = salida;
    }
    
    
    
}